package com.example.mapper;

import com.example.pojo.Privilege;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author testjava
 * @since 2022-08-20
 */
@Mapper
public interface PrivilegeMapper extends BaseMapper<Privilege> {
    List<Privilege> selectWithChildren(Integer pid);

    List<Privilege> selectRootPrivilege();

    List<String> selectPrivilegeNames(@Param("uid") Integer uid);

    List<Privilege> selectByParentId(@Param("parentId") Integer parentId);

    List<Integer> selectPrivilegeIds(@Param("uid") Integer uid);
}
